CentOS 7
Sponsored Link

OpenStack Pike : How to use Ceilometer(Cinder)
2017/10/01
 
This is how to use OpenStack Telemetry Service (Ceilometer) for Cinder service.
This example is based on the emvironment like follows.
     ------------+---------------------------+---------------------------+------------
                 |                           |                           |
             eth0|10.0.0.30              eth0|10.0.0.50              eth0|10.0.0.51
     +-----------+-----------+   +-----------+-----------+   +-----------+-----------+
     |    [ Control Node ]   |   |    [ Storage Node ]   |   |    [ Compute Node ]   |
     |                       |   |                       |   |                       |
     |  MariaDB    RabbitMQ  |   |      Open_vSwitch     |   |        Libvirt        |
     |  Memcached  httpd     |   |        L2_Agent       |   |     Nova_Compute      |
     |  Keystone   Glance    |   |        L3_Agent       |   |      Open_vSwitch     |
     |  Nova_API  Cinder_API |   |     Metadata_Agent    |   |        L2_Agent       |
     |  Neutron_Server       |   |     Cinder_Volume     |   |  Ceilometer_Compute   |
     |  Metadata_Agent       |   |        Heat_API       |   |                       |
     |  Gnocchi              |   |      Heat Engine      |   |                       |
     |  Ceilometer_Central   |   |                       |   |                       |
     +-----------------------+   +-----------------------+   +-----------------------+

[1] Change settings for Cinder service to enable Telemetry data collention like follows.
Change on all Nodes Cinder services are running.
[root@dlp ~(keystone)]#
vi /etc/cinder/cinder.conf
# add to the end

[oslo_messaging_notifications]
driver = messagingv2
transport_url = rabbit://openstack:password@10.0.0.30
[root@dlp ~(keystone)]#
systemctl restart openstack-cinder-api openstack-cinder-scheduler

[2] It's some example to display metrics and meters.
# list resources

[root@dlp ~(keystone)]#
openstack metric resource list

+--------------------------------------+----------+----------------------------------+
| id                                   | type     | project_id                       |
+--------------------------------------+----------+----------------------------------+
| 81563c32-75b3-4426-a0a9-95390d6fddf5 | instance | 27f776933c3b469ba0c07deba6b57752 |
+--------------------------------------+----------+----------------------------------+
----------------------------------+--------------------------------------+----------------------------------+
 user_id                          | original_resource_id                 | started_at                       |
----------------------------------+--------------------------------------+----------------------------------+
 8145f0cd8aab4d00b36f2d2da4ba5337 | 81563c32-75b3-4426-a0a9-95390d6fddf5 | 2017-09-29T06:13:49.003232+00:00 |
----------------------------------+--------------------------------------+----------------------------------+
----------+----------------------------------+--------------+-----------------------------------------------+
 ended_at | revision_start                   | revision_end | creator                                       |
----------+----------------------------------+--------------+-----------------------------------------------+
 None     | 2017-09-29T06:13:49.003272+00:00 | None         | f3ddbcb50b35481786dc468e49181678:626d31665c71 |
----------+----------------------------------+--------------+-----------------------------------------------+

# test to create a volume

[root@dlp ~(keystone)]#
openstack volume create --size 10 disk01

# list resources

[root@dlp ~(keystone)]#
openstack metric resource list

+--------------------------------------+----------------------------+----------------------------------+----
| id                                   | type                       | project_id                       | ...
+--------------------------------------+----------------------------+----------------------------------+----
| 81563c32-75b3-4426-a0a9-95390d6fddf5 | instance                   | 27f776933c3b469ba0c07deba6b57752 | ...
| 1f972805-b86f-4f03-ab9d-33a0ce9733fb | volume                     | 27f776933c3b469ba0c07deba6b57752 | ...
+--------------------------------------+----------------------------+----------------------------------+----

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show 1f972805-b86f-4f03-ab9d-33a0ce9733fb

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 626d31665c7140ab82d88b78c4073798                                  |
| created_by_user_id    | 11d3d7a1c08343d9ac7cff4d9354a73f                                  |
| creator               | 11d3d7a1c08343d9ac7cff4d9354a73f:626d31665c7140ab82d88b78c4073798 |
| ended_at              | None                                                              |
| id                    | 1f972805-b86f-4f03-ab9d-33a0ce9733fb                              |
| metrics               | snapshot.size: b70b4f35-ab75-4f02-94c4-70a4cdf56bf9               |
|                       | volume.backup.size: 2d073ce6-6f34-4ecf-8b69-54283ee6af90          |
|                       | volume.size: c50d21ce-d33a-447b-aad9-5da4e06df91f                 |
|                       | volume.snapshot.size: 91fe988a-f5c8-42b0-8431-ab791f8a8296        |
|                       | volume: 157b26fc-c670-4e5d-8d9c-f94a21ef1b83                      |
| original_resource_id  | 1f972805-b86f-4f03-ab9d-33a0ce9733fb                              |
| project_id            | 27f776933c3b469ba0c07deba6b57752                                  |
| revision_end          | None                                                              |
| revision_start        | 2017-10-02T04:35:12.872375+00:00                                  |
| started_at            | 2017-10-02T04:35:12.872348+00:00                                  |
| type                  | volume                                                            |
| user_id               | 8145f0cd8aab4d00b36f2d2da4ba5337                                  |
+-----------------------+-------------------------------------------------------------------+

# display volume size

[root@dlp ~(keystone)]#
openstack metric measures show c50d21ce-d33a-447b-aad9-5da4e06df91f

+---------------------------+-------------+-------+
| timestamp                 | granularity | value |
+---------------------------+-------------+-------+
| 2017-10-02T04:35:00+00:00 |       300.0 |  10.0 |
+---------------------------+-------------+-------+
 
Tweet